package com.homson.coreservice.servicecommon.enumeration;

/**
 * @author: homson_leo
 * @contact: hey_超级巨星（Homson_Leo）- 刘泓岑 1196816884@qq.com
 * @time: 2025/10/19 2:51 PM
 * 账户一级类型
 **/
public enum AccountTypeEnum {
    
    DOM_BANK(2001, "境内银行账户"),
    FOREIGN_BANK(2000, "境外银行账户"),
    CRYPTO(2002, "加密账户"),
    FUND(2003, "基金账户"),
    LOAN(2004, "贷款账户"),
    STOCK(2005, "股票账户"),
    OTHERS(2006, "其它");
    
    private Integer code;
    private String cName;
    
    AccountTypeEnum(Integer code, String desc) {
        this.code = code;
        this.cName = desc;
    }
    
    public Integer getCode() {
        return code;
    }
    
    public String getDesc() {
        return cName;
    }
    
    public static AccountTypeEnum of(Integer code) {
        for (AccountTypeEnum value : values()) {
            if (value.code.equals(code)) {
                return value;
            }
        }
        return null;
    }
}
